import { BasicsEntity } from 'src/common/entities/common.entity';
import { Column, Entity, JoinColumn, JoinTable, OneToMany } from 'typeorm';
import { DictItem } from '../../dict-item/entities/dict-item.entity';

@Entity({ name: 'sys_dict_type' })
export class DictType extends BasicsEntity {
  @Column({ comment: '字典名称' })
  dictName: string;

  @Column({ comment: '字典类型' })
  dictCode: string;

  @Column({ comment: '状态' })
  status: number;

  @Column({ comment: '备注' })
  remark: string;

  @OneToMany(() => DictItem, (dictItem) => dictItem.dictType, {
    onDelete: 'CASCADE',
  })
  dictItems: DictItem[];
}
